<?php
require_once 'classes/Login.php';
require_once 'classes/Employer.php';
require_once 'classes/JobPost.php';
$Login = new Login;
$Employer = new Employer;
$JobPost = new JobPost;
$categories = $JobPost->getCategoriesEdit();
if(!$Login->verify())
{
    header('Location:index.php');
}
if(($Login->superUser($_SESSION['employerID']))) {
	$companyName = $Login->getCompanyName($_SESSION['employerID']);
	$employerInfo = $Employer->getInactiveEmployerDetails();
	include 'includes/header.inc.php';
	?>
	<script language="JavaScript">
    function verifyRestore()
    {
     return confirm('Are you sure you want to restore this user?');
    }
    </script>
    <a href="/sandbox1/myAccount.php">My Account</a>&nbsp;|&nbsp;
    <a href="/sandbox1/jobCategories.php">Job Categories</a>&nbsp;|&nbsp;
    <a href="myEmployers.php">Active Employers</a>
	<div id="form">
                <h1>Edit Job Categories</h1>
                    <fieldset id="jobPostingForm">
                            <form id="jobPostForm" method="post" action="/sandbox1/previewPost.php">
                                    
                                    <p>
                                        <label for="jobTitle">New Category: </label>
                                        <input type="text" name="category" id="category" class="input" value="" style="width:450px;"/>
                                    </p>
                                    
                                <p>
                                    <input type="submit" name="previewPost" id="previewPost" class="button" value="Update Job Info" />
                                </p>
                            </form>
                    </fieldset>
                   
                    <fieldset id="jobPostingForm">
                    	<legend>Current Categories</legend>
                    		<form><div align="left"><?php
                            for($n=0;$n<count($categories);$n++)
                            {
								if(count($categories) > 1){
								   echo '<img src="/sandbox1/media/images/spacer.png" width="180" />
								   		<a href="javascript:void(0);" id="updateLocation" style="text-decoration:none" title="Update This Category">
                                   		<img src="/sandbox1/media/images/update.png" alt="Update Cat" style="padding-right:5px;"/></a>
								   		<a href="javascript:void(0);" id="removeLocation" title="Remove This Category">
                                   		<img src="/sandbox1/media/images/delete.png" style="padding-right:5px;" /></a>&nbsp;&nbsp;';
								   echo '<font size="4">';
                                   echo '<input type="text" name="category" class="input" value="'.$categories[$n][1].'" style="width:250px;"/>';
                                   echo '</font><br/>';
								
								}
								else {
								   
								}
                            } ?>
                            	
                                 
                              
                            </div></form>
                    </fieldset>
                   
            </div>
<?php           
}
else {  header('Location:index.php'); }    ?>
        
        <?php include 'includes/footer.inc.php';
?>
		